package com.qf.feign;

import com.qf.conf.FeignLoggerConfig;
import com.qf.pojo.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

//feign接口定义时，不支持将共性路径像写Controller那样提取
//@RequestMapping("/order")

//标注这个接口是一个Feign远程调用接口，并表名访问的是哪个服务
//R r = restTemplate.getForObject("http://QF-ORDER/order/" + id, R.class);
@FeignClient(value = "QF-ORDER",fallback = OrderServiceFallback.class,configuration = FeignLoggerConfig.class)
public interface OrderServiceFeign {
    @GetMapping("/order/{id}")
    public R findByUid(@PathVariable("id") Integer id);
}
